<?php

class SubscriberModel extends ArrayProcessor_XMLElements {

	
	
	public static function getSubMenuData ()  {
		
		$xml = AutoFileLoader::getFileContent(AutoFileLoader::FILE_XML, 'subscribersListViewSubMenu');
		
		$submenu = array();
		
		$submenu[self::ELE_GENERAL] = self::XMLToHTMLArray($xml, self::ELE_GENERAL, '');
		
		$submenu[self::ELE_STRUCTURE] = self::XMLToHTMLArray($xml, self::ELE_STRUCTURE, '');
		
		return $submenu;
		
	}
	
	public static function getEditSubscriberContent ()  {
		$xml = AutoFileLoader::getFileContent(AutoFileLoader::FILE_XML, 'subscriberEdit');
	
		$content = array();
	
		$content[self::ELE_GENERAL] = self::XMLToHTMLArray($xml, self::ELE_GENERAL, '');
	
		$content[self::ELE_STRUCTURE] = self::XMLToHTMLArray($xml, self::ELE_STRUCTURE, '');
	
		return $content;
	}
	
	
	/**
	 * Get all subscribers from tx_ttnewsletter_subscriber
	 * @return array
	 */
	public static function getSubscriberData ()  {
		$subscribers = Subscriber::getSubscribers();
		return $subscribers;
	}
	
	/**
	 * Get the subscriber with the uid that is passed over
	 * 
	 * structure of $_POST[uid]
	 * 		0 => uid1
	 * 		1 => uid2
	 * 
	 * @return array
	 */
	public static function getEditSubscriberData ($subscriberUid)  {
		$subscriber = Subscriber::getSubscriber($subscriberUid);
	
		return $subscriber;
	}
}